<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">

<h:body>
	<ui:composition template="/secured/workarea.xhtml">
		<ui:define name="espacio_trabajo">
			<h:form styleClass="login" id="form">
				<table>
					<tr>
						<td align="left">
							<div class="breadcrumb flat" style="text-align: left">
								<h:commandLink action="#{menuBean.regresaInicio}" value="Inicio" />
								<h:outputLink value="#" styleClass="active">#{msg.estatusTiposDocs}</h:outputLink>
							</div>
						</td>
					</tr>
				</table>
				<p:growl id="growl" showDetail="true" />
				<p:panel>
					<h:outputText
						value="#{msg.frsEstatusoDocs}"
						style="text-align:left;" />
				</p:panel>
				<p:panel>
					<p:commandButton id="deleteButton" value="#{msg.eliminar }"
						icon="ui-icon-trash" onclick="borrarDialog.show()" update="growl"
						rendered="#{beanEDoc.borrar}" />
					<p:commandButton id="editarButton" value="#{msg.editar }"
						icon="ui-icon-pencil" oncomplete="editarDialog.show()"
						update=":form:displayEditar, growl" rendered="#{beanEDoc.cambios}" />
					<p:commandButton id="viewButton" value="#{msg.ver }"
						actionListener="#{beanEDoc.showVer }" icon="ui-icon-search"
						oncomplete="verDialog.show()" update=":form:displayVer, growl"
						rendered="#{beanEDoc.consulta}" />
					<p:commandButton id="nuevoButton" value="#{msg.nuevo }"
						icon="ui-icon-plusthick" onclick="nuevoDialog.show()"
						update="growl" rendered="#{beanEDoc.alta}" />
				</p:panel>
				<p:panel>
					<p:dataTable id="table" value="#{beanEDoc.listItems}" var="item"
						rowKey="#{item.idEstatus}" paginator="true"
						selection="#{beanEDoc.itemSelected}" paginatorPosition="bottom"
						rows="#{beanTabla.noRegistros}">
						<p:column selectionMode="single" style="width:2%" />
						<p:column id="id" headerText="#{msg.nombre}"
							sortBy="#{item.descEstatus}" filterBy="#{item.descEstatus}">
							<h:outputText id="idCell" value="#{item.descEstatus}" />
						</p:column>
						<p:column id="name2" headerText="#{msg.observaciones}"
							sortBy="#{item.obsEstatus}" filterBy="#{item.obsEstatus}">
							<h:outputText id="nameCell2" value="#{item.obsEstatus}" />
						</p:column>
					</p:dataTable>
					<h:panelGroup>
						<h:panelGrid columns="3" style="text-align:left;">
							<h:outputText value="#{msg.registrosPP}"
								style="font-size:x-small" />
							<h:panelGroup>
								<h:inputText size="3"
									style="font-size:x-small; height:15px; width:25px"
									value="#{beanTabla.registros}" id="noRegistrosPP" />
								<p:watermark value="#{beanTabla.noRegistros}"
									for="noRegistrosPP" />
							</h:panelGroup>
							<p:commandButton icon="ui-icon-arrowrefresh-1-w"
								style="font-size:x-small" update="table"
								actionListener="#{beanTabla.actualizaRegistros}" />
						</h:panelGrid>
					</h:panelGroup>
					<!-- Panel de Ver -->
					<p:dialog id="dialog" header="#{msg.ver}" widgetVar="verDialog"
						modal="true" draggable="false" width="300px" height="250px">
						<h:panelGrid id="displayVer" columns="2">
							<h:panelGroup id="messagePanelVer" layout="block">
								<h:messages errorStyle="color: red" infoStyle="color: green"
									layout="list" style="font-size:12px;font-family:Arial" />
							</h:panelGroup>
							<h:outputText />
							<h:outputText value="#{msg.nombre}" />
							<p:inputText value="#{beanEDoc.itemSelected.descEstatus}"
								style="font-weight:bold; width:150px" readonly="true" />
							<h:outputText value="#{msg.observaciones}" />
							<p:inputText value="#{beanEDoc.itemSelected.obsEstatus}"
								style="font-weight:bold; width:150px" readonly="true" />
							<h:outputText />
							<p:commandButton id="aceptarVerBtn" value="#{msg.aceptar}"
								icon="ui-icon-check" onclick="verDialog.hide()" />
						</h:panelGrid>
					</p:dialog>
					<!-- Fin de panel de Ver -->
					<!-- Panel de Nuevo -->
					<p:dialog id="dialogNuevo" header="#{msg.nuevo}"
						widgetVar="nuevoDialog" modal="true" draggable="false"
						width="300px" height="250px">
						<h:panelGrid id="displayNuevo" columns="2">
							<h:panelGroup id="messagePanelNuevo" layout="block">
								<h:messages errorStyle="color: red" infoStyle="color: green"
									layout="list" style="font-size:12px;font-family:Arial" />
							</h:panelGroup>
							<h:outputText />
							<h:outputText value="#{msg.nombre}" />
							<p:inputText value="#{beanEDoc.input_nuevoNombre}"
								style="font-weight:bold; width:150px" />
							<h:outputText value="#{msg.observaciones}" />
							<p:inputText value="#{beanEDoc.input_nuevoDesc}"
								style="font-weight:bold; width:150px" />
							<p:commandButton id="cancelarNuevoBtn" value="#{msg.cancelar}"
								icon="ui-icon-check" oncomplete="nuevoDialog.hide()" />
							<p:commandButton id="aceptarNuevoBtn" value="#{msg.aceptar}"
								icon="ui-icon-check" actionListener="#{beanEDoc.save}"
								update="table growl" />
						</h:panelGrid>
					</p:dialog>
					<!-- Fin de panel de Nuevo -->
					<!-- Panel de Edicion -->
					<p:dialog id="dialogEditar" header="#{msg.editar}"
						widgetVar="editarDialog" modal="true" draggable="false"
						width="300px" height="250px">
						<h:panelGrid id="displayEditar" columns="2">
							<h:panelGroup id="messagePanelEditar" layout="block">
								<h:messages errorStyle="color: red" infoStyle="color: green"
									layout="list" style="font-size:12px;font-family:Arial" />
							</h:panelGroup>
							<h:outputText />
							<h:outputText value="#{msg.nombre}" />
							<h:panelGroup>
								<p:inputText value="#{beanEDoc.input_editNombre}"
									style="font-weight:bold; width:150px" id="input_editNombreID" />
								<p:watermark value="#{beanEDoc.itemSelected.descEstatus}"
									for="input_editNombreID" />
							</h:panelGroup>
							<h:outputText value="#{msg.observaciones}" />
							<h:panelGroup>
								<p:inputText value="#{beanEDoc.input_editDesc}"
									style="font-weight:bold; width:150px" id="input_editDescID" />
								<p:watermark value="#{beanEDoc.input_nuevoDesc}"
									for="input_editDescID" />
							</h:panelGroup>
							<p:commandButton id="cancelarEditarBtn" value="#{msg.cancelar}"
								oncomplete="editarDialog.hide()" />
							<p:commandButton id="aceptarEditarBtn" value="#{msg.aceptar}"
								icon="ui-icon-check" actionListener="#{beanEDoc.update}"
								update="table growl" />
						</h:panelGrid>
					</p:dialog>
					<!-- Fin de panel de Edicion -->
					<!-- Panel de borrado -->
					<p:confirmDialog showEffect="fade" widgetVar="borrarDialog"
						header="#{msg.confirmar }" message="#{msg.frsBorrarConfirmacion }">
						<p:commandButton value="#{msg.si }"
							actionListener="#{beanEDoc.delete}" update="table growl"
							styleClass="ui-confirmdialog-yes" icon="ui-icon-check"
							oncomplete="borrarDialog.hide()" />
						<p:commandButton value="#{msg.no }" type="button"
							styleClass="ui-confirmdialog-no" icon="ui-icon-close"
							onclick="borrarDialog.hide()" />
					</p:confirmDialog>
					<!-- Fin de panel de borrado -->
				</p:panel>
			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>